import static java.lang.Thread.sleep;

public class Demo5 {
    public static int count;
    public static void main(String[] args) throws InterruptedException {
        Thread thread1 = new Thread(() -> {//运行时间短
            for (int i = 0; i < 5000; i++) {
                count++;
            }
        });
        Thread thread2 = new Thread(() -> {//运行时间长
            for (int i = 0; i < 5000; i++) {
                count++;
            }
        });
        thread1.start();
        thread1.join();
        thread2.start();
        thread2.join();
        System.out.println(count);
    }
}
